package ModelLayer;
import java.util.ArrayList;
/**
 * Vestbjerg project
 * @GroupB2 (UCN - Computer Science DMAJ0914) 
 */
public class Customer extends Person
{
    //instance variables
    private String type; // business or private
    private int discount;
    private ArrayList<Purchase> purchases;
    private int account;
    private boolean reminder;
    
    private static int idCount = 0;
    
    /**
     * Constructor for objects of class Customer
     */
    public Customer(String id, String name, String address, String phone, String email, String type)
    {
        super(id,name,address,phone,email);
        this.type = type;
        discount = 10;
        purchases = new ArrayList<Purchase>();

        if(this.type.equals("business")) 
        {
            makeAccount();
            reminder = false;
        }

    }

    private void makeAccount() 
    {
        account = 0;
    }

    public void setType(String type)
    {
        this.type = type;
        if(this.type.equals("business")) 
        {
            makeAccount();
            reminder = false;
        }
        else if(this.type.equals("private"))
        {
            account = 0;
        }
    }

    public void setReminder(boolean newReminder) 
    {
        reminder = newReminder;
    }

    public void setDiscount(String discount)
    {
        this.type = type;
    }

    public String getType()
    {
        return type;
    }

    public int getDiscount()
    {
        return discount;
    }
}